package mc933.proj.clickposition;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;

public class ListPoints extends MapActivity {
	private static final int CENTER_LATITUDE = (int) (-22.817723 * 1E6);
	private static final int CENTER_LONGITUDE = (int) (-47.068305 * 1E6);
	private MapView map;
	private MapController controller;

	private MapPoints mapPoints;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.maps);

		Intent intent = getIntent();

		
		String listPoints = intent.getStringExtra("listPoints");
		Log.i("lista", listPoints);
		map = (MapView) findViewById(R.id.map);
		map.setBuiltInZoomControls(true);

		controller = map.getController();

		// Set center point of map
		GeoPoint centerPoint = new GeoPoint(CENTER_LATITUDE, CENTER_LONGITUDE);

		controller.setCenter(centerPoint);
		controller.animateTo(centerPoint);
		controller.setZoom(16);

		mapPoints = new MapPoints(this, getResources().getDrawable(R.drawable.icon_by_bus), listPoints);
		if (mapPoints.size() > 0) {
			map.getOverlays().add(mapPoints);
		}
	}

	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}

}
